package com.example.slogantv.base;

import android.app.Application;
import android.content.Context;
import android.net.NetworkInfo;

import androidx.annotation.Nullable;
import androidx.multidex.MultiDex;

import com.carlt.networklibs.NetworkManager;
import com.dueeeke.videoplayer.BuildConfig;
import com.dueeeke.videoplayer.exo.ExoMediaPlayerFactory;
import com.dueeeke.videoplayer.ijk.IjkPlayerFactory;
import com.dueeeke.videoplayer.player.VideoView;
import com.dueeeke.videoplayer.player.VideoViewConfig;
import com.dueeeke.videoplayer.player.VideoViewManager;

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        VideoViewManager.setConfig(VideoViewConfig.newBuilder()
                .setLogEnabled(BuildConfig.DEBUG)
                .setPlayerFactory(IjkPlayerFactory.create())
                .setPlayerFactory(ExoMediaPlayerFactory.create())
//                半屏 全屏
//                .setEnableOrientation(true)
//                解码方式
//                .setEnableMediaCodec(true)
//                是否可滑动
//                .setUsingSurfaceView(true)
//                是都支持多开
//                .setEnableParallelPlay(true)
//                焦点是否监听
//                .setEnableAudioFocus(false)
                .setScreenScaleType(VideoView.SCREEN_SCALE_DEFAULT)
                .build());
//        网络监听
        NetworkManager.getInstance().init(this);

    }


    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);

    }
}
